<template>
    <div class="face">
        <div class="fm">
            <img class="fm-img" :src="require('@/assets/images/zhuishu.png')" alt="">
            <div class="button" @click="gotomian">跳过 {{count}} S</div>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {
            count:5,
            timer:null,
        }
    },
    methods:{
        gotomian(){
            this.$router.push({name:"main"})
        }
    },
    mounted(){
        this.timer=setInterval(()=>{
            if(this.count>1){
                this.count--
            }else{
                clearInterval(this.timer);
                this.timer = null;
                this.$router.push({name:'main'})
            }
        },1000)
    }
}
</script>

<style lang="scss" scoped>
.fm{
    width: 100%;
    height: 100%;
    padding: 20px;
    background-color: #fff;
    position: relative;
     .fm-img{
      width: 100%;
      height: 100%;
  }
  .button{
        position: absolute;
        top:20px;
        right:20px;
        border:1px solid #ccc;
        background: rgba(0,0,0,0.2);
        color:#fff;
        border-radius: 20px;
        width:70px;
        height:28px;
        line-height: 28px;
        z-index:1000;
        text-align: center;
    }
}
 
</style>